<?

$t_detect_forward_url = '../set_flash_settings.php';
$t_flash_swf_url = '../flash_detection.swf';
$t_flash_javascript_file = '../AC_OETags.js';

if ( !session_id() ) session_start();

$t_checked = FALSE;
$t_javascript = FALSE;
$t_flash = FALSE;
$t_cookies = FALSE;
if ( $_SESSION['flash_checked'] ) {
	if ( $_SESSION['flash_version'] ) $t_flash = intval($_SESSION['flash_version']);
	$t_checked = TRUE;
	if ( !isset($_GET[session_name()]) ) $t_cookies = 'TRUE';
	if ( $_SESSION['j'] ) $t_javascript = 'TRUE';
} else {
	setcookie('c', '1', time()+3600, '/');
	$_SESSION['redirect_url'] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . ($_SERVER['QUERY_STRING']? '?' . $_SERVER['QUERY_STRING']: ''); //  . session_name() . '=' . session_id();
}

?><!DOCTYPE html
		PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<title>Unobtrusive jQuery Flash Detection</title>

	<? if ( !$t_checked ) { ?>
	<script language="Javascript">
	/* <![CDATA[ */
		<? include($t_flash_javascript_file) ?>
		var flashversion = AC_OETags.GetSwfVer();

		window.location = '<?=$t_detect_forward_url?>?j=1&flash_version=' + flashversion;
	/* ]]> */
	</script>
	<? } ?>

	<link rel="stylesheet" type="text/css" href="../flash_detection.css" media="all" />
</head>
<body class="<?=$t_flash?'hasFlash':''?>">
	<? if ( !$t_flash ) { ?>
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="1" height="1" id="F_detect" align="middle" style="position: absolute; left: -1px; top: -1px;">
		<param name="allowScriptAccess" value="sameDomain" />
		<param name="movie" value="<?=$t_flash_swf_url?>?redirect_url=<?=$t_detect_forward_url?>%3F<?=session_name()?>%3D<?=session_id()?>%26flash_version=" />
		<embed src="<?=$t_flash_swf_url?>?redirect_url=<?=$t_detect_forward_url?>%3F<?=session_name()?>%3D<?=session_id()?>%26flash_version=" quality="high" bgcolor="#3B526A" width="1" height="1" name="F_detect" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" style="position: absolute; top: -1px; left: -1px;" />
	</object>
	<? } ?>

	<h2>Flash Settings</h2>
	<p>Flash: <?=$t_flash?></p>
	<p>Javascript: <?=$t_javascript?></p>
	<p>Cookies: <?=$t_cookies?></p>
	<p><a href="flash_detection.example.php">this</a></p>

	<h2>Unobtrusive jQuery Flash Detection</h2>

	<h2>Show Alternate Content if No Flash Installed:</h2>
	<div id="alternate" class="swf">
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="302" height="304" title="Deactivate &quot;Push to Click&quot;">
				<param name="movie" value="swf/2_clock.swf" />
				<param name="quality" value="high" />
				<embed src="swf/2_clock.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="302" height="304"></embed>
		</object>
		<div class="alt">
			&lt;blink>12:00&lt;/blink>
		</div>
	</div>
</body>
</html>